package com.huawei.control.order;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.huawei.bean.Address;
import com.huawei.model.OrderModel;
import com.huawei.utils.EasyFactory;

/**
 * Servlet implementation class orderModifyJumpControl
 */
@WebServlet("/orderModifyJumpControl")
public class orderModifyJumpControl extends HttpServlet {
	private static final long serialVersionUID = 1L;
    /**
	 * @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		System.out.println("进入修改跳转页面");
		// 接收前台form表单的数据
				// 从request中获取id主键值
				String strAid = request.getParameter("aid");		
				// 调用model层查询该id的所有的记录信息
				Address addressB = EasyFactory.getNewInstance(OrderModel.class).queryAddressById(strAid);
				 //将查询结果缓存到session中
				request.getSession().setAttribute("modifyAddressBean", addressB);
				 //跳转到修改页面
				request.getRequestDispatcher("WEB-INF/pages/HWSC/orderModify.jsp").forward(request, response);
				
		
	}

}
